package algdat;

public class Ovning17 {

    public static int digSum(int n) {
        if (n == 0) {
            return 0;
        } else {
            return (n % 10) + digSum(n / 10);
        }
    }

    public static void main(String[] args) {
        System.out.println(digSum(123456789));
    }
}
